package com.telecom.entity;

import lombok.Data;

import java.util.List;
@Data
public class Teacher {
    private String name;
    private String job;
    private List<Student> students;
    public void teach(){
        students.forEach(student -> {
            if (student.getAge() > 12){
                System.out.println(student.getName()+"年龄超过12岁");
            }else{
                System.out.println(student.getName()+"可以正常读书");
            }
        });
    }
}
